#include "Thread.hpp"
#include <vector>
#include <mutex>

using namespace ThreadModule;
using std::vector;

int printCount(int val)
{
    static int count = 0;
    count += val;
    std::cout << "count = " << val << std::endl;
    return count;
}

void test()
{
    vector<std::string> data_v;
    for(int i = 0; i < 5; i++)
    {
        data_v.emplace_back("thread-" + std::to_string(i + 1));
    }

    using ThreadType = Thread;
    vector<ThreadType*> thread_v;
    for(int i = 0; i < 5; i++)
    {
        thread_v.emplace_back(
            new ThreadType ( data_v.at(i), printCount, 100));
    }

    for(auto& e: thread_v)
    {
        e->join();
        delete e;
    }
}

int main()
{
    test();
    return 0;
}